//
//  smartPointTest.hpp
//  learnC++
//
//  Created by liuzhibing on 2018/7/1.
//  Copyright © 2018年 yunfan.com. All rights reserved.
//

#ifndef smartPointTest_hpp
#define smartPointTest_hpp

#include <stdio.h>
#include <iostream>

class Person3 {
private:
    int m_age;
    
public:
    
    Person3(int age = 0):m_age(age){
        
    }
    
    ~Person3(){
        
    }
    
    Person3(const Person3 &p){
        m_age = p.m_age;
        std::cout << "复制构造函数\n";
    }
    
    Person3 &operator=(const Person3 &p){
        m_age = p.m_age;
        std::cout << "赋值构造函数\n";
        return *this;
    }
    
    
};

void TestPerson3(Person3 a);


/*
 Person3 p2 = p1;此时表示初始化

 //下面才是赋值
 Person3 p1;
 Person3 p2(2);
 p2 = p1;
 */
template <class T>
class TestPtr {
    
    
public:
    T *m_ptr;
    
    TestPtr(){
        
    }
    
    void test(){
        m_ptr->addRef();
    }
    
};



#endif /* smartPointTest_hpp */
